import os
import DOC_Process
import PDF_Process
import XLS_Process
import shutil

'''
# 韩泽旭
file_path = "D:/课题/data"
result_path = "D:/课题/data/result"
'''
# 闫佳琪
file_path = "./wzj2"
result_path="./PDF2"

# 马妍
# path=""
# result_path=""

if __name__ == '__main__':
    list = os.listdir(file_path)

    for i in list:
        type = os.path.splitext(i)[1]
        if type == ".docx" or type == ".doc":
            # DOC_Process.fun(os.path.basename(i))
            continue
        elif type == ".pdf":
            pdf_name = os.path.basename(i).split('.')[0]
            print(pdf_name)
            PDF_Process.fun(pdf_name)
            continue
        # elif type == ".jpg" or type == ".png" or type == ".jpeg":
        #
        # elif type == ".xls" or type == ".xlsx":
        #     print(os.path.basename(i))
        #     result_path = './XLS'
        #     if(type=='.xlsx'):
        #         XLS_Process.fun(os.path.basename(i))
        #     if(type=='.xls'):
        #         XLS_Process.fun2(os.path.basename(i))

        #
        # elif type==".zip" or type==".rar":

    # 解决txt少于normal的问题
    # 将图片扫描成的pdf找出来
    # list = os.listdir("./PDF/txt")
    # target = './PDF/pic'
    # sum = 0
    #
    # for i in list:
    #     name = os.path.splitext(i)[0]
    #     if(os.path.exists("./PDF/txt/" + name + '.txt')):
    #         continue
    #     else:
    #         sum = sum + 1
    #         shutil.move('./PDF/normal/' + i, target)
    #         print(name)



